/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package database;
import java.sql.*;
/**
 *
 * @author Donghui
 */
public class Delete {
    final String url = "jdbc:mysql://192.168.222.101/isc?user=root&password=root&useUnicode=true";
    private Connection deleteOpt = null;
    private Statement deleteStatement = null;
    private String sql;
    private static Delete local;

    public static Delete getInstance(){
        if(local==null){
            local = new Delete();
        }
        return local;
    }

    public void deleteValue(String temp)
    {
        sql=temp;
        try{
        Class.forName("com.mysql.jdbc.Driver");
        deleteOpt = DriverManager.getConnection(url);
        deleteOpt.setCatalog("isc");
        deleteStatement=deleteOpt.createStatement();
        deleteStatement.executeUpdate(sql);
        deleteStatement.close();
        deleteOpt.close();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
}
